package cn.edu.ctbu.websql.controller;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping( "/students")

public class StudentController {
    @GetMapping("list")
    public String list(HttpServletRequest httpServletRequest ,Model model){
        HttpSession session = httpServletRequest.getSession();
        if(session.getAttribute("userId")==null){
            return "redirect:/login/user";
        }
        return "students/list";
    }

}
